import { createApp } from 'vue'
import App from './App.vue'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import router from './router'
import { createPinia } from 'pinia'
import csDialoga from '@/components/dialog.vue'
import './assets/style/common.scss'
// import pxToVw from './directives/pxToVw'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
const app = createApp(App);
// app.directive('px-to-vw', pxToVw)
app.component('csDialoga', csDialoga)

// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue))  {app.component(key, component) }

const pinia = createPinia()
app.use(pinia);
app.use(ElementPlus, {
  locale: zhCn,
})
app.use(router);

app.mount('#app')
